import 'package:fluro/fluro.dart';
import './handler.dart';

class Routes {

  static void configureRoutes(Router router) {
    router.notFoundHandler =emptyHandler;     //空页面
    router.define("/",handler:indexHandler);
    router.define("/goods/detail",handler:goodsDetailHandler);
  }

  // static final _routes = {
  //   '/': (BuildContext context, { Object args }) => Index(),
  //   '/goods/detail': (BuildContext context, {Object args}) => GoodsDetail()
  // };

  // static Router _singleton;

  // Router._internal();

  // factory Router() {
  //   if(_singleton == null) {
  //     _singleton = Router._internal();
  //   }

  //   return _singleton;
  // }

  // /// 监听route
  // Route getRoutes(RouteSettings settings) {
  //   String routeName = settings.name;
  //   final Function builder = Router._routes[routeName];

  //   print(settings);

  //   if(builder == null) {
  //     return null;
  //   } else {
  //     return MaterialPageRoute(
  //       settings: settings, 
  //       builder: (BuildContext context) => builder(context, args: settings.arguments)
  //     );
  //   }
  // }
}